package com.itranswarp.learnjava.service;

import org.springframework.stereotype.Component;
import org.springframework.core.annotation.Order;

@Component
@Order(3)
public class ValidatePhone implements ValidateInterface {
    @Override
    public void validate(String email, String phone, String name) {
        if (!phone.matches("^1[3-9]\\d{9}$")) {
            throw new IllegalArgumentException("invalid phone: " + phone);
        }

    }
}